<?php

namespace App\Http\Controllers;

use App\New;
use Illuminate\Http\Request;

class NewController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function Adds(Request $request)
    {
        $this->validate($request,[
          'newsname'=>'required',
          'news'=>'required',
          'newstime'=>'required',  
        ]);
        $data=User::Adds($request);
        if($data)
        {
            return redirect('show');
        }
        else{
            return redirect('add');
        }
    }
    public function Shows(Request $request)
    {
      return view('news.show',['$arr'=>$data]);
      $data=User::Shows($request);
    }
    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        //
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        //
    }

    /**
     * Display the specified resource.
     *
     * @param  \App\New  $new
     * @return \Illuminate\Http\Response
     */
    public function show(New $new)
    {
        //
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  \App\New  $new
     * @return \Illuminate\Http\Response
     */
    public function edit(New $new)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\New  $new
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, New $new)
    {
        //
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  \App\New  $new
     * @return \Illuminate\Http\Response
     */
    public function destroy(New $new)
    {
        //
    }
}
